#include "iostream"
#include "math.h"
using namespace std;
int flag=0;
int main()
{   int counter=0;
bool isPrime(int);
    for(int i=1;i<=1000;i+=2)
    {
        flag=isPrime(i);
        
        if(flag)
        {
            flag=0;
            counter++;
            cout<<i<<"\t";
            if(counter%8==0&&counter!=0)      
            cout<<endl;
        }
    }
    cout<<endl<<"The num og Prime is"<<counter;
    return 0;
}


// }
bool isPrime(int i)
{
    for(int n=2;n<=sqrt(i);n++)
        {
            if(i%n!=0) 
            {flag=1;
                
            }
            else{
                flag=0;
                break;
            }
        }
    return flag;
}